package com.study.flowable.springboot.controller;


import com.study.flowable.springboot.service.WorkFlowTaskService;
import org.flowable.app.model.common.ResultListDataRepresentation;
import org.flowable.app.service.editor.FlowableModelQueryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @author sjw
 * @description
 * @date 2019-08-31 下午3:12
 */

@RestController
@RequestMapping("/app/rest")
public class FlowableController {


    @Autowired
    private WorkFlowTaskService workFlowTaskService;

    //    @Autowired
    protected FlowableModelQueryService modelQueryService;


    @GetMapping(value = "/models", produces = "application/json")
    public ResultListDataRepresentation getModels(@RequestParam(required = false) String filter, @RequestParam(required = false) String sort, @RequestParam(required = false) Integer modelType,
                                                  HttpServletRequest request) {

        return modelQueryService.getModels(filter, sort, modelType, request);
    }


}
